import request from './request'

// 获取验证码
export function getCode(data) {
    return request({
        url: '/register/getcodebyemail',
        method: 'post',
        data
    })
}

// 用户注册
export function register(data) {
    return request({
        url: '/register/register',
        method: 'post',
        data
    })
}

export function addadmin(data){
    return request({
        url: '/register/addadmin',
        method: 'post',
        data
    })
}

// 用户登录
export function login(data) {
    return request({
        url: '/login/login',
        method: 'post',
        data
    })
}
// 获取用户信息
export function getUserInfo(data) {
    return request({
        url: '/user/getuserinfo',
        method: 'post',
        data
    })
}

//修改用户信息
export function updateUserInfo(data) {
    return request({
        url: '/user/updateuserinfo',
        method: 'post',
        data,
    })
}

export function updatePassGetCode(data) {
    return request({
        url: '/user/updatepassgetcode',
        method: 'post',
        data
    })
}

export function updatePass(data) {
    return request({
        url: '/user/updatepass',
        method: 'post',
        data
    })
}

export function getTags(){
    return request({
        url: '/posts/gettags',
        method: 'get',
    })
}

export function addPost(data){
    return request({
        url: '/posts/addpost',
        method: 'post',
        data
    })
}

export function getalluser(data){
    return request({
        url: '/user/getalluser',
        method: 'post',
        data
    })
}

export function changuserdeleted(data){
    return request({
        url: '/user/changuserdeleted',
        method: 'post',
        data
    })
}

export function getuserByName(data){
    return request({
        url: '/user/getuserbyname',
        method: 'post',
        data
    })
}

export function getalladminuser(data){
    return request({
        url: '/user/getalladminuser',
        method: 'post',
        data
    })
}

export function changadminuserdeleted(data){
    return request({
        url: '/user/changadminuserdeleted',
        method: 'post',
        data
    })
}

export function getadminuserByName(data){
    return request({
        url: '/user/getadminuserbyname',
        method: 'post',
        data
    })
}

export function getallpost(data){
    return request({
        url: '/posts/getadminposts',
        method: 'post',
        data
    })
}

export function changpostisreview(data){
    return request({
        url: '/posts/reviewpost',
        method: 'post',
        data
    })
}

export function disablepost(data){
    return request({
        url: '/posts/disablepost',
        method: 'post',
        data
    })
}

export function getAdminPostByName(data){
    return request({
        url: '/posts/getadminpostbyname',
        method: 'post',
        data
    })
}

export function getcommentsbyisreview(data){
    return request({
        url: '/comment/getcommentsbyisreview',
        method: 'post',
        data
    })
}

export function reviewcomment(data){
    return request({
        url: '/comment/reviewcomment',
        method: 'post',
        data
    })
}

export function disableComment(data){
    return request({
        url: '/comment/disablecomment',
        method: 'post',
        data
    })
}

export function getCommentByName(data){
    return request({
        url: '/comment/searchcommentbyname',
        method: 'post',
        data
    })
}

export function getmypost(data){
    return request({
        url: '/posts/getmypost',
        method: 'post',
        data
    })
}

export function getpostbyid(data){
    return request({
        url: '/posts/getpostbyid',
        method: 'post',
        data
    })
}

export function getcommentbypostid(data){
    return request({
        url: '/comment/getcommentsbypostid',
        method: 'post',
        data
    })
}

export function addcomment(data){
    return request({
        url: '/comment/addcomment',
        method: 'post',
        data
    })
}

export function addreply(data){
    return request({
        url: '/comment/addreply',
        method: 'post',
        data
    })
}

export function addlike(data){
    return request({
        url: '/posts/likepost',
        method: 'post',
        data
    })
}

export function cancelike(data){
    return request({
        url: '/posts/cancellikepost',
        method: 'post',
        data
    })
}

export function addcollect(data){
    return request({
        url: '/posts/collectpost',
        method: 'post',
        data
    })
}

export function cancelcollect(data){
    return request({
        url: '/posts/cancelcollectpost',
        method: 'post',
        data
    })
}

export function getlikepost(data){
    return request({
        url: '/posts/getlikes',
        method: 'post',
        data
    })
}

export function getcollectpost(data){
    return request({
        url: '/posts/getcollects',
        method: 'post',
        data
    })
}

export function searchmypost(data){
    return request({
        url: '/posts/getmypostbyname',
        method: 'post',
        data
    })
}

export function searchlikepost(data){
    return request({
        url: '/posts/getlikepostbyname',
        method: 'post',
        data
    })
}

export function searchcollectpost(data){
    return request({
        url: '/posts/getcollectpostbyname',
        method: 'post',
        data
    })
}

export function getallhome(data){
    return request({
        url: '/posts/gethome',
        method: 'post',
        data
    })
}

export function searchhome(data){
    return request({
        url: '/posts/searchhome',
        method: 'post',
        data
    })
}

export function getrecommend(data){
    return request({
        url: '/posts/getrecommendpost',
        method: 'post',
        data
    })
}